#ifndef MEMPOOL_H_INCLUDED
#define MEMPOOL_H_INCLUDED

#include "Book.h"
#include "Tag.h"
#include "Typedef.h"
#include "BookInfoList.h"

class MemPool
{
public:
    MemPool();
    ~MemPool();

public:
    list<Book*> BookList;
    list<Tag*> TagList;

    BookInfoList* InfoList;

public:
    void InsertThisBook(Book* book);
    Book* FindBookByID(uint32_t BookID);
    Book* FindBookByName(string BookName);
    BPcode ReleaseBookByID(uint32_t BookID);
    BPcode ReleaseBookByName(string BookName);
    BPcode ReleaseAllBooks();

    void InsertThisTag(Tag* tag);
    Tag* FindTagByID(uint32_t TagID);
    Tag* FIndTagByName(string TagName);
    BPcode ReleaseTagByID(uint32_t TagID);
    BPcode ReleaseAllTags();
};

#endif // MEMPOOL_H_INCLUDED
